package com.zy.ioc.pro6_ioc_scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class ScopeTest {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(ScopeTest.class);
        Product product1 = context.getBean(Product.class);
        Product product2 = context.getBean(Product.class);
        System.out.println(product1 == product2);
    }
}
